package modelLayer;

public class PartSalesOrder {

	private String partSalesOrderID;
	private int noOfItems;
	private double totalamount;
	private Product product;
	private SalesOrder salesOrder;
	
	
	
	
	public PartSalesOrder(Product product)
	{
		setProduct(product);
		
		
	}
	
	public PartSalesOrder(Product p, int noOfItems)
	{
		setProduct(p);
		setNoOfItems(noOfItems);
		calculateAmount();
	}
	
	public PartSalesOrder()
	{}
	
	
	public void setProduct(Product product)
	{
		this.product = product;
	}
	
	public Product getProduct()
	{
		return product;
	}
	
	
	public String getPartSalesOrderID() 
	{
		return partSalesOrderID;
	}
	
	public void setPartSalesOrderID(String partSalesOrderID) 
	{
		this.partSalesOrderID = partSalesOrderID;
	}
	
	public int getNoOfItems() 
	{
		return noOfItems;
	}
	
	public void setNoOfItems(int noOfItems) 
	{
		this.noOfItems = noOfItems;
	}
	
	public double getTotalamount() 
	{
		return totalamount;
	}
	
	public void setTotalamount(double totalamount) 
	{
		this.totalamount = totalamount;		
	}
	
	public void calculateAmount()
	{
		this.totalamount = noOfItems*product.getSalesPrice();
	}

	public SalesOrder getSalesOrder() {
		return salesOrder;
	}

	public void setSalesOrder(SalesOrder salesOrder) {
		this.salesOrder = salesOrder;
	}
	
	
	
	
	
}
